/**
 * Created by zxh on 14-7-15.
 */

ms.UIBarChart =  ms.UILayer.extend({

    initLayer: function () {
        this._ccsFileName = "barChart.json";
        this._super();
        this.setContentSize(this.rootNode.getSize());
        return true;
    },


    setData: function(key, percent) {
        var image = this["_image" + key];
        if (!image) {
            return;
        }

        image.scaleX = percent / 100;

        var label = this["_label" + key];
        label.setString(percent + "%");
        var rect = image.getBoundingBox();
        var x = rect.x + 400 * image.scaleX;
        label.setPositionX(x);
    }


});